<template>
  <div class="login-pc-error-view">
    <div class="login-pc-error-view-content">
      <img :src="noDataImage" alt="">
      <div class="login-pc-error-view-content-text">
        页面出错了，请稍后再试或联系我们反馈
      </div>
      <el-button
        type="primary"
        class="login-button"
        @click.prevent="openUserFeedBack"
      >
        反馈问题
      </el-button>
      <div class="login-pc-error-view-content-tip">
        您可以联系您的专属客服经理进行处理 <br>
        或者拨打全国统一客服热线：400-882-8865
      </div>
    </div>
    
    <!--start 用户意见反馈   -->
    <create-feed-back
      ref="createFeedback"
      @searchFeedBack="openFeedBackList"
    >
    </create-feed-back>
    <feed-back-list
      ref="feedbackList"
      @createFeedback="openUserFeedBack"
    >
    </feed-back-list>
    <!--end 用户意见反馈   -->
  </div>
</template>

<script>
/* components */
import CreateFeedBackDialog from '@src/modules/system/frame/component/userFeedback/CreateFeedBackDialog.vue';
import FeedBackListDialog from '@src/modules/system/frame/component/userFeedback/FeedBackListDialog.vue';
/* util */
import { getRootWindow } from '@src/util/dom'

const rootWindow = getRootWindow(window)
import { getOssUrl } from '@src/util/assets'
const noDataImage = getOssUrl('/no_data.png')

export default {
  name: 'error-view',
  components: {
    [CreateFeedBackDialog.name]: CreateFeedBackDialog,
    [FeedBackListDialog.name]: FeedBackListDialog
  },
  data() {
    return {
      //
      noDataImage,
    }
  },
  methods: {
    openUserFeedBack () {
      
      if (rootWindow.openUserFeedBack) {
        return rootWindow.openUserFeedBack()
      }
      
      this.$refs.createFeedback.openDialog();
    },
    openFeedBackList () {
      this.$refs.feedbackList.openDialog();
    },
  }
}
</script>

<style lang="scss">
.login-pc-error-view {
  background-color: #fff;
  width: 100%;
  height: 100%;
}

.login-pc-error-view-content {
  display: flex;
  flex-flow: column;
  align-items: center;
  justify-content: center;
  padding-top: 170px;
  width: 100%;
  img {
    width: 160px;
    height: 160px;
  }
  .el-button {
    width: 86px;
    height: 32px;
    background: $color-primary-light-6;
    border-radius: 4px;
    border-color: $color-primary-light-6;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 15px;
    margin: 16px 0;
  }
}

.login-pc-error-view-content-text {
  color: #171A1D;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  height: 20px;
  margin-top: 8px;
}

.login-pc-error-view-content-tip {
  height: 66px;
  font-size: 14px;
  font-weight: 400;
  color: rgba(23, 26, 29, 0.4);
  line-height: 22px;
  text-align: center;
}
</style>
